home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / XML Utilities / Professional Programmer XSL IDE / Xselerator25.msi / Data.Cab / F22358_InputForm.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2001-10-04  |  1.6 KB  |  56 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <xsl:stylesheet version="1.0"  
  3. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  4.  ><xsl:output method="html" encoding='iso-8859-1'/>
  5.  
  6.  
  7. <xsl:template match="/">
  8.  
  9. <!--The following variable will store the language to be used.  Note
  10. that we are determining the language using the xml:lang attribute -->
  11. <xsl:variable name="isolang">
  12.     <xsl:value-of select="/employees/@xml:lang"/>
  13. </xsl:variable>
  14.  
  15. <!--Generate the path where the heading files are stored.  Note how the
  16. language determines the name of the file that contains the translations -->
  17. <xsl:variable name="headingpath" select="concat('translations/',$isolang,'/headings.xml')"/>
  18.  
  19. <META http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  20.  
  21.  
  22. <xsl:for-each select="employees/employee">
  23.  
  24.             <xsl:for-each select="*">
  25.                 <xsl:value-of select="@desc"/>
  26.  
  27.             <xsl:variable name="fieldname"  select="name(.)"/>
  28.  
  29.  
  30.         <!-- Look up header using the current element name -->
  31.         <xsl:variable name="fieldheader" select="document                            ($headingpath)/headings/heading[@category=$fieldname]"/>
  32.  
  33.  
  34.     
  35.             <xsl:value-of select="$fieldheader"/>
  36.                     <xsl:element name="input">
  37.  
  38.                     <!-- Set the Size of the textbox -->
  39.                     <xsl:attribute name="size">
  40.                         <xsl:value-of select="@size"/>
  41.                     </xsl:attribute>
  42.  
  43.                     <!-- Set the value of the text box -->
  44.                     <xsl:attribute name="value">
  45.                         <xsl:value-of select="text()"/>
  46.                     </xsl:attribute>
  47.                     <br/>
  48.                 </xsl:element>
  49.  
  50.  
  51.     </xsl:for-each>
  52. </xsl:for-each>
  53. </xsl:template>
  54.  
  55. </xsl:stylesheet>
  56.